package com.zcx.base;

import android.app.Activity;
import android.app.Dialog;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import com.zcx.common.Helper;

/**
 * @author：zcx
 * @date:on 2018/3/7 0007 10:17
 */

public class BaseDialog extends Dialog {
    public BaseDialog(@NonNull Activity context) {
        super(context);
    }

    public BaseDialog(@NonNull Activity context, int themeResId) {
        super(context, themeResId);
    }

    protected BaseDialog(@NonNull Activity context, boolean cancelable, @Nullable OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    @Override
    public void show() {
        try {
            if (Helper.isNotNull(getContext()) && getContext() instanceof Activity && ((Activity) getContext()).isFinishing()) {
                return;
            }
            if (true) {
                super.show();
            }
        } catch (Exception e) {
        }
    }
}
